package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	s := make([]int, 10)
	initData22_1(s)
	fmt.Println(s) // [30 56 4 55 41 55 59 32 31 54]

	bubbleSort3(s)
	fmt.Println(s) //[4 30 31 32 41 54 55 55 56 59]
}

func bubbleSort3(s []int) {
	for i := 0; i < len(s)-1; i++ {
		for j := 0; j < len(s)-1-i; j++ {
			if s[j] > s[j+1] {
				s[j], s[j+1] = s[j+1], s[j]
			}
		}
	}
}

func initData22_1(s []int) {
	rand.Seed(time.Now().UnixNano())

	for i := 0; i < len(s); i++ {
		s[i] = rand.Intn(100)
	}
}
